package Algorithms.chapter1;

public class EX11 {

    public static void printBooleanMatrix(boolean[][] matrix){
        System.out.print(" ");
        for(int i=0;i<matrix[0].length;i++){
            System.out.print(i);
        }
        System.out.println();
        for(int i=0;i<matrix.length;i++){
            System.out.print(i);
            for (int j=0;j<matrix[i].length;j++){
                if(matrix[i][j]) System.out.print("*"); //System.out.print(matrix[i][j] ? '*' : ' '); //可替换为
                else System.out.print(" ");
            }
            System.out.println();
        }
    }


    public static void main(String[] args) {
        boolean[][] a = {{true,false,true,true},{false,true,false,true},{true,true,false,true}};
        printBooleanMatrix(a);

    }
}
